#ifndef _MAPMANAGEMENT_H_
#define _MAPMANAGEMENT_H_

#include "Enemy.h"
#include "Soldier.h"
#include <vector>
#include <fstream>

#include "Canon_Red.h"
#include "Canon_White.h"
#include "Box.h"
#include "Tile.h"
#include "StandShoot.h"
#include "WaterShoot.h"
#include "HideShoot.h"
#include "RunningMan.h"
#include "Convert.h"

using namespace std;

struct Map {
	wstring				mapName_;
	vector<CTile*>		vectorTiles_;
	vector<CEnemy*>		vectorEnemies_;
	float				mapWidth;
	float				mapHeight;
};

class CMapManagement
{
private:
	vector<Map*>	loadedMaps_;		//	Include information of all map which loaded
	Map*			currentMap_;		//	Current playing map
public:
	CMapManagement();
	~CMapManagement();
	void	readMap(wstring mapName);	//	Read a map
	bool	isLoad(wstring mapName);	//	Check if the map was loaded.
	void	reloadMap(wstring mapName);	//	Reload a loaded map to use

	void	loadEnemies();				//	Load all of enemies
	void	loadTiles();				//	Load all of tiles
	void	loadSoldier();				//	Load all of Soldier in viewport

	void	Update(DWORD deltaTime);
	void	UpdateAI(D3DXVECTOR3 position);
	void	Render();

	CEnemy* getCanon() {
		return currentMap_->vectorEnemies_[0];
	}

	CEnemy* getSoldier() {
		return currentMap_->vectorEnemies_[1];
	}

};
#endif

